<?php

/**
 * Book form.
 *
 * @package    Bookstore
 * @subpackage form
 * @author     Enkuso
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class BookForm extends BaseBookForm
{
  public function configure()
  {
      $this->widgetSchema['introduction'] = new sfWidgetFormWysightml5();
      $this->widgetSchema['cover'] = new sfWidgetFormFileupload(array('file_src'=>""));
      $this->widgetSchema['published_year'] = new sfWidgetFormYearPicker();
      $this->widgetSchema['meta'] = new sfWidgetFormTextarea(array(),array('rows'=>5,'class'=>'input-xlarge'));
      $this->widgetSchema['tag'] = new sfWidgetFormTagsInput(array('model'=>'Tag'));

      // label
      $this->getWidget('title')->setLabel('Номын нэр');
      $this->getWidget('introduction')->setLabel('Номын тухай');
      $this->getWidget('meta')->setLabel('Мета мэдээлэл');
      $this->getWidget('cover')->setLabel('Хавтасны зураг');
      $this->getWidget('published_year')->setLabel('Хэвлэгдсэн он');
      $this->getWidget('isbn_code')->setLabel('ISBN код');
      $this->getWidget('page_count')->setLabel('Хуудасны тоо');
      $this->getWidget('language')->setLabel('Хэл');
      $this->getWidget('is_bestseller')->setLabel('Bestseller');
      $this->getWidget('is_draft')->setLabel('Засварлаж дуусаагүй');
      $this->getWidget('category_id')->setLabel('Ангилал');
      $this->getWidget('author_id')->setLabel('Зохиогч/редактор');

      $this->validatorSchema->setOption('allow_extra_fields', true);
  }
}
